package pkleczek.bugbrain.laboratory.elements;

import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.RectF;

public class Neuron extends CircutElement {

	private static final Paint paint;

	private final RectF oval = new RectF();

	static {
		paint = new Paint();
		paint.setColor(Color.GREEN);
	}

	@Override
	public int getSize() {
		return 3;
	}

	@Override
	public void draw(Canvas canvas, int tileSize) {
		int halfSize = getSize()/2;
		
		oval.set((getPosition().x - halfSize) * tileSize,
				(getPosition().y - halfSize) * tileSize,
				(getPosition().x + halfSize + 1) * tileSize,
				(getPosition().y + halfSize + 1) * tileSize);

		canvas.drawOval(oval, paint);
	}
}
